This application relates to the operation of re-programmable non-volatile memory systems such as semiconductor flash memory, and, more specifically, to the management of individually erasable blocks of a memory array.
There are two primary techniques by which data communicated through external interfaces of host systems, memory systems and other electronic systems are addressed. In one of them, addresses of data files generated or received by the system are mapped into distinct ranges of a continuous logical address space established for the system in terms of logical blocks of data (hereinafter the “LBA interface”). The extent of the address space is typically sufficient to cover the full range of addresses that the system is capable of handling. In one example, magnetic disk storage drives communicate with computers or other host systems through such a logical address space. This address space has an extent sufficient to address the entire data storage capacity of the disk drive.
Flash memory systems are most commonly provided in the form of a memory card or flash drive that is removably connected with a variety of hosts such as a personal computer, a camera or the like, but may also be embedded within such host systems. When writing data to the memory, the host typically assigns unique logical addresses to sectors, clusters or other units of data within a continuous virtual address space of the memory system. Like a disk operating system (DOS), the host writes data to, and reads data from, addresses within the logical address space of the memory system. A controller within the memory system translates logical addresses received from the host into physical addresses within the memory array, where the data are actually stored, and then keeps track of these address translations. The data storage capacity of the memory system is at least as large as the amount of data that is addressable over the entire logical address space defined for the memory system.
In current commercial flash memory systems, the size of the erase unit has been increased to a block of enough memory cells to store multiple sectors of data. Indeed, many pages of data are stored in one block, and a page may store multiple sectors of data. Further, two or more blocks are often operated together as metablocks, and the pages of such blocks logically linked together as metapages. A page or metapage of data are written and read together, which can include many sectors of data, thus increasing the parallelism of the operation. Along with such large capacity operating units come challenges in operating them efficiently.
For ease of explanation, unless otherwise specified, it is intended that the term “block” as used herein refer to either the block unit of erase or a multiple block “metablock,” depending upon whether metablocks are being used in a specific system. Similarly, reference to a “page” herein may refer to a unit of programming within a single block or a “metapage” within a metablock, depending upon the system configuration.
When the currently prevalent LBA interface to the memory system is used, files generated by a host to which the memory is connected are assigned unique addresses within the logical address space of the interface. The memory system then commonly maps data between the logical address space and pages of the physical blocks of memory. The memory system keeps track of how the logical address space is mapped into the physical memory but the host is unaware of this. The host keeps track of the addresses of its data files within the logical address space but the memory system operates with little or no knowledge of this mapping.
In the second of the two system interface techniques that are used, data files generated or received by an electronic system are uniquely identified and their data logically addressed by offsets within the file. A form of this addressing method is used between computers or other host systems and a removable memory card known as a “Smart Card.” Smart Cards are typically used by consumers for identification, banking, point-of-sale purchases, ATM access and the like, and contain a small amount of memory when compared to flash memory cards and flash drives.
In the patent applications cross-referenced above, a data file is identified in the mass storage flash memory system by a filename assigned by the host and data of the file are accessed by offset addresses within the file (hereinafter “direct data file interface”). The memory system then knows the host file to which each sector or other unit of data belongs. The file unit being discussed herein is a set of data that is ordered, such as by having sequential logical offset addresses, and which is created and uniquely identified by an application program operating in a host computing system to which the memory system is connected.
The four utility patent applications referenced above (application Ser. Nos. 11/382,224; 11/382,228; 11/382,232; 11/382,235), filed on May 8, 2006), describe techniques in which lists of blocks are maintained for access during operation of the memory system. Individual entries on the lists include parameters of memory blocks and their addresses. An entry within a list may be selected according to either the physical address of the block to which it relates, or the value of a block parameter that is recorded within the entry. The present description relates to storing one or more lists of data blocks within a designated block in flash memory, and accessing a specific entry in a list on the basis of the information content of a field within the entry.
The technique uses some of the logical pages in the designated block for storage of unordered records containing information of all blocks on two or more lists. Other pages are used for lists of entries containing only a content-addressable parameter for the blocks, and a pointer to the full record for the block. Entries in these lists are stored in order of the parameter values, and an entry with a specific parameter value can quickly be accessed. The lists act as a form of directory to the unordered records for the blocks.
In a block-erasable nonvolatile memory, maintaining up-to-date information on individual blocks and the data they contain allows efficient memory management. Where blocks contain a mixture of valid data of one or more files, obsolete data, and erased space this may be quite complex. However, by keeping track of such data on a block-by-block basis, certain memory system operations, particularly reclaiming of unused space in the memory array, may be efficiently performed. Reclaim of unused space (space containing obsolete data or unusable erased space) takes place on a block-by-block basis (where a block is the unit of erase). It is desirable to perform block reclaim operations on blocks in an efficient order, to reduce copying of valid data. To determine the order of block reclaim, it is useful to have blocks ranked in order of one or more descriptor values, where a descriptor value is descriptive of at least one aspect of the data stored in a block. For example, blocks may be ordered by the amount of valid data they contain so that those blocks containing the least amount of valid data may be quickly identified to be reclaimed first.
In a first example, records are maintained for a variety of blocks in the memory array, though not necessarily all blocks. Blocks containing valid data are classified according to whether they contain erased space (partial blocks) and if not, whether they contain obsolete data (obsolete blocks). Blocks with only obsolete data (invalid blocks) and blocks containing only erased space (erased blocks) are separately classified. A record is maintained for each block having one of these classifications. Records are maintained in dedicated record blocks. In addition, blocks in a classification are listed in lists that are ordered by a descriptor value. The descriptor value may be the amount of valid data in the block, the address of the block or some other descriptor value. List entries, in the first example, contain pointers to corresponding records.
In a second example, records are also maintained for blocks in various classifications. The classification “complete common block” is added for a block that contains data of more than one file and that does not contain obsolete data or erased space. Records are maintained in dedicated record pages in dedicated record blocks. A record may contain a variety of information regarding the corresponding block including its block address, the amount of valid data it contains, position of write pointer etc.
A directory is provided to allow an individual record to be rapidly found. An entry in the directory identifies a record page and the location of the corresponding record in that record page. The directory is maintained in dedicated directory pages in a directory block, with directory entries ordered by block address. Directory pages contain non-overlapping block address ranges. One directory page may contain pointers to more than one record page. However, a record page contains only records pointed to by entries of one directory page. Thus, when records in a record page are updated, only one directory page needs to be updated.
Directory blocks may also contain one or more lists. An entry in a list contains a block address and a descriptor value and entries in a list are ordered by descriptor value. An exemplary descriptor value is the amount of valid data in a block. Lists provide a convenient way to select a block for reclaim or other purposes based on data in the block. For example, the obsolete block with the least amount of valid data is the first entry in a list of obsolete blocks that uses the amount of valid data as descriptor value. This block can be rapidly identified from the list for reclaim so that the list provides a queue for reclaim operations. In other examples, a block with a particular descriptor value may be sought. This may be identified rapidly by performing a binary search on the appropriate list page.
In a third example, a record is maintained for each block in the nonvolatile memory array at all times. In this case, a directory page contains entries for a fixed block address range with entries sequentially ordered by block address. Because this provides an entry for a particular block at a predetermined offset within a directory page, entries do not have to contain the block address of the block to which they refer.
Although the techniques of managing and accessing lists are described herein for use with flash memory operating with a flash data file interface, these techniques may also be used with other types of lists in different applications.